#ifndef PLAYMODE_H
#define PLAYMODE_H

#include <QWidget>
#include <SeriovyPort.h>
#include <phonon>
#include <QFileDialog>
#include <QMessageBox>


#include "playlist.h"

namespace Ui {
class PlayMode;
}

class PlayMode : public QWidget
{
    Q_OBJECT
    
public:
    explicit PlayMode(QWidget *parent = 0);
    ~PlayMode();

    void setPort(QtSeriovyPort *port);

private:
    Ui::PlayMode *ui;
    PlayList *playList;

    QtSeriovyPort *port;

    QString strPlayList;

    //sound
    Phonon::MediaObject *mediaObject;
    Phonon::AudioOutput *audioOutput;
    Phonon::Path *path;
    Phonon::SeekSlider *progresSlider;
    Phonon::VolumeSlider *volumeSlider;

private slots:

    //slot for Phonon support
    void tiknuti(qint64 h);
    void newPalayerState(Phonon::State newstate, Phonon::State oldstate);
    void addToPlayList();
    void aboutToFinish();
    void finished();
    void play();
    void pause();
    void stop();
    void songActivated(QString filePath);
    void savePlayListAs();
    void savePlayList();

    void openPlayList();
    void newPlayList();

public slots:

    void nextSong();
    void previousSong();
    void changeAudioDevice();

signals:
};

#endif // PLAYMODE_H
